<script>
import {defineComponent} from 'vue'
import instance from "@/api/axios";

export default defineComponent({
    name: "SwiperView",
    created() {
        instance.get('https://wkt.myhope365.com//weChat/applet/course/banner/list').then(res => {
            this.course=res.data;
            console.log(res)
        })
    },
    data() {
        return {
            course: '',

        }
    },
})
</script>

<template>
    <div>
        <div class="box">
            <div class="outer">
                <a-carousel arrows autoplay>
                    <div
                            slot="prevArrow"
                            class="custom-slick-arrow"
                            style="left: 10px;zIndex: 1"
                    >
                        <a-icon type="left-circle"/>
                    </div>
                    <div slot="nextArrow" class="custom-slick-arrow" style="right: 10px">
                        <a-icon type="right-circle"/>
                    </div>
                    <div v-for="item in course" :key="item.id" class="imgbox">
                        <img :src="item.imgUrl">
                    </div>

                </a-carousel>
            </div>

        </div>
    </div>
</template>

<style scoped lang="less">
.box {
  width: 80%;
  margin: -45px auto 0 auto;
  overflow: hidden;
  background-color: #fff;
  height: 432px;
  border-radius: 20px;
}
</style>
<style scoped>
/* For demo */
.ant-carousel >>> .slick-slide {
    text-align: center;
    line-height: 160px;
    background: #364d79;
    overflow: hidden;
    height: 400px;
    border-radius: 10px;

}

.ant-carousel >>> .custom-slick-arrow {
    width: 25px;
    height: 25px;
    font-size: 25px;
    color: #fff;
    background-color: rgba(31, 45, 61, 0.11);
    opacity: 0.3;

}

.ant-carousel >>> .custom-slick-arrow:before {
    display: none;
}

.ant-carousel >>> .custom-slick-arrow:hover {
    opacity: 0.5;
}

.ant-carousel >>> .slick-slide h3 {
    color: #fff;
}

.outer {
    margin: 12px auto;
    width: 96%;
    height:400px;
}
.imgbox>img{
    display: block;

    width: 100%;

}
</style>